<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>阻止冒泡和阻止超链接</title>
	</head>
	<body>
			
			 <div id="app" @click="addNum">
				<h3>用户数据：{{num}}</h3>
				<input type="text" v-model="num2" v-on:keyup.enter="addNum"> 
				<button type="button" @click.stop="addNum">计算</button><!-- 阻止冒泡 -->
				<a  href="http://www.baidu.com"  @click.prevent="addNum">baidu</a><!-- 阻止超链接 -->
			 </div>
			 <!-- 1.导入js文件-->
			 <script src="../js/vue.js"> </script>
			 <!-- 3.创建vue对象-->
			 <script>
				 
				const APP =new Vue({
					//1.注定区域
					el: "#app",
					data: {
						num:100,
						num2:0
					},
					methods:{
						addNum(){
							this.num+=parseInt(this.num2)
						}
					}
					
				})
			 </script>
		</body>
	</html>
	